<extend name="Public/layout" />
<block name="body">
    <link rel="stylesheet" href="/Public/Wap/css/e.css">
    <link rel="stylesheet" href="/Public/Wap/css/ec.css">
    <script src="/Public/Wap/js/vue.js"></script>
    <script src="/Public/Wap/js/e.js"></script>
    <link rel="stylesheet" href="/Public/Wap/css/dy/index.css">

    <div style="margin-top: 40px" id="vmRoot" class="vm-container">
        <el-form :model="ruleForms" ref="ruleForms" label-width="100px" class="demo-ruleForm">
            <el-row class="item-top top">
              
                    <el-form-item label="token内容：">
                        <el-input  rows="10"  type="textarea" v-model="ruleForms.token"></el-input>
                    </el-form-item>
              
               
                    <el-button type="primary" @click="setPass">提交</el-button>
                
            </el-row>
        </el-form>
    </div>
    <script>
        new Vue({
            el: '#vmRoot',
            data: function () {
                return {
                    ruleForms:{
                        token:''
                    }
                }
            },
            created() {

            },
            methods: {
                setPass() {
                    $.post(`/kcadmin/jd/tokenModify`, {token:this.ruleForms.token}, res => {
                        if(res.code == 1){
                            this.$message({
                                message: '操作成功',
                                type: 'success'
                            });
                        }else{
                        this.$message({
                            message: res.msg,
                            type: 'success'
                        });
                    }
                    })
                },
                getDetail() {
                    let that = this;
                    $.post('{:U("/kcadmin/jd/getToken")}', {}, function (res) {
                        if (res.code == 1) {
                            that.ruleForms.token = res.data.cookier_value;
                        }
                    })
                }
            },
            mounted() {
                this.getDetail()
            }
        })
    </script>
</block>
<style>
  .el-textarea__inner {
    height: 100px
    }
</style>